home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
editor
/
wf314.zip
/
WF311DOC.ZIP
/
DOCS
/
WF.017
< prev
next >
Wrap
Text File
|
1992-01-31
|
21KB
|
586 lines
.f3 - # - Chapter 17 - Mail Merge
.rm70
.tc
.tc 17. MAIL MERGE ........................................#
CHAPTER 17 MAIL MERGE
.imData Files
.imMerge Printing
.irFormletters;Formletters - see Merge Printing
Mail Merge, or Merge Printing, is the process of inserting information
into a document while it is being printed. The document is often
printed several times with different information. The most common use
of merge printing is to merge mailing list information into a form
letter or mailing labels. Other applications include invoices,
reports, and any other standard document that requires you to fill in
blanks.
.ix Master Document
.ix Template Document
To merge print you need to create the form or template document (also
called the master document). You usually need a data file as well. You
then print the master document using the background print command Ctrl
K P. Word fugue will obey the mail merge dot commands, and insert
information in place of variables in your master document. If you are
using a data file, a copy of the document will be produced for each
set of information in the data file.
A master document contains the text of the document and the
instructions for how the documents are to be produced. These
instructions include variables and special merge print dot commands.
An example would be a form letter and a data file of names and
addresses.
.tc Variables ..........................................#
Variables
.ix Variables
.ix Mail merge labels
.ixAmpersands;Ampersands in Master Document
.ixLabels,;Labels, merge printing
.ixFields;Fields
.ixFields;Field Names
A variable is information that changes from one copy of the document
to another. When you merge print, Word Fugue inserts information for
each variable into each copy. This information can come from a data
file, or you can be prompted for it when you print.
Each variable has a name, and you place the name of the variable into
the master document wherever information is to be inserted. The actual
information inserted in place of the variable is called data.
A variable name can contain up to 20 characters. You can use uppercase
and lowercase letters interchangeably. You can make a name more
readable by using hyphens (-) or underscores (_) to join words in the
variable name.
Where you want to insert variable data, type the variable name between
ampersands (&) in the text of the document:
&person-name& Fred Nurk
&ADDress_1& The street
&city&, &state& &postcode& Erehwon, XYZ 9000
If you have never set a value for a variable, it is termed
uninitialised. These variables print their own name, to aid you in
finding them. They usually happen when you misspell their name. word
Fugue cannot match the misspelling, and so prints the name instead.
.tc Merge Print Dot Commands ...........................#
Merge Print Dot Commands
.ix Dot Commands
You type dot commands in the master document to tell Word Fugue the
variable names and where to get the data that goes into them. If you
do not obtain data for a variable name, Word Fugue will print the name
instead. You cannot use a piece of data which is longer than 80
characters. The total amount of data to be merged is limited by the
memory available on your PC.
The following dot commands are available:
.DF filename delim
.RV variable list
.AV prompt,variable
.SV variable=value
.MA variable=equation
.DM message
.GO go to top of file and start again
.WS Y or N for Wordstar compatible variable
replacement
.ixDot Commands; .DF - Data File
.ix Dot Commands
.ix Data File (.DF)
.ixDF;.DF - Data File
.ixData Files; Selecting for merge printing (.DF)
The .DF command defines the data file containing the variables to be
merged into the text. If you follow the filename by at least one
blank and another character, then that character is used as a
delimiter instead of a comma
eg .DF names.dat /
means that the file NAMES.DAT contains the variables to be read, and
that the separator between variables is a slash (/). The default is
comma (,).
.ixDot Commands; .RV - Read Variable
.ix Read Variable .RV
.ix Data Files
.ixCommas;Commas in data files
.ixData Files; Creating
.ixData Files; Examples
.ixRV;.RV - Read Variable
.ixData Files; Naming fields for merge printing (.RV)
A data file consists of a series of records. Each record consists of
one or more fields or items of information. For example, a mailing
list has a field for name, a field for address line one, and a field
for address line 2.
The .RV command defines the variables to be found on a single line of
the data file. You can have more that one .RV to define different
lines of your master document. If a line of the data file is exhausted
before all the variables are read, the remainder are set to blank.
eg .RV name,address1,address2
means that each line of the file will look like this:
Joe Bloggs,17 West street,Newtown DG 9999
If you want to leave a variable blank, then leave it out:
Joe Bloggs,,Newtown Post Office DG 9999
You can use a different separator, as defined on the .DF line, and put
different variables on different lines:
.DF names.dat /
.rv name,address1
.rv address2
.cp7
Your file would then look like this:
Joe Bloggs/17 Westside Ave.,
Newtown DG 9999
.ixData Files; Creating
Make sure that the fields are in the same order in all records.
Separate fields with commas or the separator you defined on the .DF
line. Make sure that the fields on a record are consistent with the
order you defined in the .RV line(s). If a field contains a comma,
enclose the entire field in quotation marks. If a field is empty (you
have no information for it in this record), indicate the blank field
with a space and a comma.
NOTE - The rules above are very important. If you enter data
incorrectly, your merge printing will not print correctly.
.ixDot Commands; .AV - Ask for Variable
.ix Dot Commands
.ix Ask for Variable .AV
.ixAV;.AV - Ask for Variable
The .AV line will prompt you to enter the contents of the variable.
You can include an optional prompt:
.AV Address1
will display ADDRESS1? and open a window for you to enter the
value.
.AV Enter the address,address1
will display Enter the address and open a window for you to enter
the value.
.ixDot Commands; .SV - Set Variable
.ix Set Variable (.SV)
.ixSV;.SV - Set Variable
The .SV line sets the variable to the value:
.SV vara,this is the value for variable A
.SV addr= This is the address
You can use either comma (,) or equals sign (=). Leading spaces in the
variable are ignored. If you want to include leading spaces, you
should enclose the data within single or double quotes. If you start
with a single quote, you must end with a single quote, and vice
versa:
.SV company= " Fugue Software "
You can set the maximum length of a variable by placing the characters
/L and a length, or /R and a length, or /C and a length, depending on
whether you want your data Left justified or Right justified or
Centred, after the variable name:
.SV A/L15=Joe Bloggs
.SV B/R15=Joe Bloggs
.SV C =Joe Bloggs
.SV D/C15=Joe Bloggs
gives
A = "Joe Bloggs "
B = " Joe Bloggs"
C = "Joe Bloggs"
D = " Joe Bloggs "
If the line were too long, it would be truncated at the length
specified.
.ixDot Commands; .MA - Mathematical Calculations
.ix Mathematical calculations .MA
.ixMA;.MA - Mathematical calculations
The .MA line allows you to compute values a